<%--@elvariable id="webRoot" type="com.doupi.partner.op.interceptor.OpFilter"--%>
<%--@elvariable id="type" type="com.doupi.partner.op.controller.business.BusinessController.index"--%>

<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="../common/tags.jsp" %>

<!DOCTYPE html>
<html>
<head lang="en">
    <%@include file="../common/assets.jsp" %>
</head>
<body>
<!-- header -->
<%@include file="../common/header.jsp" %>

<!-- main start -->
<div class="am-cf admin-main">
    <!-- sidebar start -->
    <%@include file="../common/menu.jsp" %>
    <!-- sidebar end -->

    <!-- main start -->
    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf">
                    <strong class="am-text-primary am-text-lg">商家操作</strong> /
                    <small>编辑商家</small>
                </div>
            </div>

            <hr>
            <form action="${webRoot}/business/${type}/save" method="POST" id="administrator-edit-form">
                <input type="hidden" name="id" value="${businessRelation.id}">
                <input type="hidden" name="administratorId" value="${businessRelation.administratorId}">
                <input type="hidden" name="city" value="${businessRelation.city}">

                <div class="am-tabs am-margin" data-am-tabs="">
                    <ul class="am-tabs-nav am-nav am-nav-tabs">
                        <li class="am-active">
                            <a href="#tab-base-info">基本信息</a>
                        </li>
                    </ul>

                    <div class="am-tabs-bd" style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">

                        <%--基本信息--%>
                        <div class="am-tab-panel am-in am-active am-form" id="tab-base-info">

                            <div class="am-g am-margin-top">
                                <div class="am-u-sm-4 am-u-md-2 am-text-right">名称:</div>
                                <div class="am-u-sm-8 am-u-md-10">
                                    <input type="text" class="am-input-sm" name="name"
                                            value="${businessRelation.administrator.name}">
                                </div>
                            </div>

                            <div class="am-g am-margin-top">
                                <div class="am-u-sm-4 am-u-md-2 am-text-right">手机号:</div>
                                <div class="am-u-sm-8 am-u-md-10">
                                    <input type="text" class="am-input-sm" name="mobile"
                                            value="${businessRelation.administrator.mobile}">
                                </div>
                            </div>

                            <util:wholePermission name="business:platform">
                                <div class="am-g am-margin-top">
                                    <div class="am-u-sm-4 am-u-md-2 am-text-right">平台</div>
                                    <div class="am-u-sm-8 am-u-md-10">
                                        <select class="am-input-sm" name="source">
                                            <option value="1"
                                                    <c:if test="${businessRelation.source eq 1}">selected</c:if>>
                                                逗皮
                                            </option>
                                            <option value="2"
                                                    <c:if test="${businessRelation.status eq 2}">selected</c:if>>
                                                逗米
                                            </option>
                                                <%--<option value="3" <c:if test="${businessRelation.status eq 3}">selected</c:if>>
                                                    线下
                                                </option>--%>
                                        </select>
                                    </div>
                                </div>
                            </util:wholePermission>

                            <div class="am-g am-margin-top">
                                <div class="am-u-sm-4 am-u-md-2 am-text-right">状态</div>
                                <div class="am-u-sm-8 am-u-md-10">
                                    <select class="am-input-sm" name="status">
                                        <c:forEach items="${util:getAllBusinessStatus()}"
                                                var="item">

                                            <util:wholePermission name="business:status:${item.code}">
                                                <option value="${item.code}"
                                                        <c:if test="${businessRelation.status eq item.code}">selected</c:if>>
                                                        ${item.name}
                                                </option>
                                            </util:wholePermission>

                                        </c:forEach>
                                    </select>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>

                <div class="am-margin">
                    <button type="submit" class="am-btn am-btn-primary am-btn-xs">保存</button>
                    <button type="button" class="am-btn am-btn-primary am-btn-xs" onclick="history.go(-1)">关闭</button>
                </div>
            </form>
        </div>

    </div>

    <!-- main end -->

    <!-- foot -->

    <%@include file="../common/footer.jsp" %>
</body>
</html>